// For authoring Nightwatch tests, see
// http://nightwatchjs.org/guide#usage

//testcase name：收费查询用户
//author：feizhao
//date：2017-11-01
//discription：用于测试登陆后，收费中对用户的查询操作
//step：1.登录收费管理收费主页面  2.输入用户编号，用户姓名，电话等查询用户

const accountConfig = {
  username: '1',
  password: '1',
}
 module.exports = {
   ' tests': function (browser) {
     browser
    .url('http://127.0.0.1:8080').maximizeWindow()
     .pause(1000)
     .waitForElementVisible('body', 100)
     .setValue('input[type=text]',accountConfig.username)
     .pause(100)
     .setValue('input[type=password]',accountConfig.password)
     .pause(100)
     .click('button[id=login-button]')
     .pause(1000)
     .click('#vc-tree-name-收费管理')
     .pause(1000)
     .click('#vc-tree-name-收费')
//用户查新
     .pause(1000)
     .setValue('.form-inline :nth-child(1) input[placeholder=用户编号]','78')
     .pause(1000)
     .click('.form-inline :nth-child(17) button')
     .pause(100)
     .clearValue('.form-inline :nth-child(1) input[placeholder=用户编号')
     .pause(300)
     .setValue('input[placeholder=合同编号]','100100')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .clearValue('input[placeholder=合同编号')
     .pause(300)
     .setValue('input[placeholder=用户姓名]','张三')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .clearValue(' input[placeholder=用户姓名')
     .pause(300)
     .setValue('input[placeholder=电话]','18192592986')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .clearValue(' input[placeholder=电话')
     .pause(300)
     .setValue('input[placeholder=表编号]','3')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .clearValue(' input[placeholder=表编号')
     .pause(300)
     .setValue('input[placeholder=表号]','001001')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .click('.form-inline :nth-child(7) div button')
     .pause(100)
     .click('.form-inline :nth-child(7) div ul :nth-child(2) ')
     .pause(1000)
     .click('.form-inline :nth-child(7) div button')
     .pause(100)
     .click('.form-inline :nth-child(7) div ul :nth-child(3) ')
     .pause(1000)
     .click('.form-inline :nth-child(7) div button')
     .pause(100)
     .click('.form-inline :nth-child(7) div ul :nth-child(1) ')
     .pause(1000)
     .click('.form-inline :nth-child(8) div button')
     .pause(100)
     .click('.form-inline :nth-child(8) div ul :nth-child(3) ')
     .pause(1000)
     .click('.form-inline :nth-child(8) div button')
     .pause(100)
     .click('.form-inline :nth-child(8) div ul :nth-child(2) ')
     .pause(1000)
     .click('.form-inline :nth-child(8) div button')
     .pause(100)
     .click('.form-inline :nth-child(8) div ul :nth-child(1) ')
     .pause(100)
     .setValue('input[placeholder=用户地址]','科技二路')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(100)
     .clearValue('input[placeholder=用户地址]')
     .pause(100)
     .setValue('input[placeholder=区域]','1')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(100)
     .clearValue('input[placeholder=区域]')
     .pause(100)
     .setValue('input[placeholder=小区]','科技小区')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(100)
     .clearValue('input[placeholder=小区]')
     .pause(1000)
     .click('.form-inline :nth-child(12) div button')
    //  .pause(100)
    //  .click('.form-inline :nth-child(7) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(13) div button')
     .pause(100)
     .click('.form-inline :nth-child(13) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(13) div button')
     .pause(100)
     .click('.form-inline :nth-child(13) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(13) div button')
     .pause(100)
     .click('.form-inline :nth-child(13) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(14) div button')
     .pause(100)
     .click('.form-inline :nth-child(14) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(3) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(15) div button')
     .pause(100)
     .click('.form-inline :nth-child(15) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(16) div button')
     .pause(100)
     .click('.form-inline :nth-child(16) div ul :nth-child(2) ')
     .pause(100)
     .click('.form-inline :nth-child(16) div button')
     .pause(100)
     .click('.form-inline :nth-child(16) div ul :nth-child(1) ')
     .pause(100)
     .click('.form-inline :nth-child(17) button')
     .pause(1000)
     .end();
   }
 }
